package com.jt.controller;

import com.jt.pojo.SearchResult;
import com.jt.service.SearchService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author dc
 * @Classname SearchController
 * @Date 2020/3/27 10:50
 */
@RestController
@RequestMapping("/search")
public class SearchController {

    @Autowired
    SearchService searchService;

    @RequestMapping("/query")
    public SearchResult findItemByKey(String key, int page, int rows){
        SearchResult result = searchService.findItemByKey(key, page, rows);
        return result;
    }
}
